package com.dq.service.common.impl;

import com.dq.vo.Vo;

import com.dq.domain.position.OrgPosition;
import com.dq.domain.sys.user.user.StaffUser;
import com.dq.domain.sys.user.user.base.SysUser;
import com.dq.repository.BaseRepositories;
import com.dq.service.common.CommunalService;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Author luchangtong
 * @Date 2020/1/6 17:01
 */
@Service
public class CommunalServiceImpl extends BaseRepositories implements CommunalService {
    @Override
    public Vo findStaffByOrg() {
        return null;
    }

    @Override
    public Vo findAllPosition() {
        List<OrgPosition> positions = orgPositionRepository.findByDeletedFalse();
        List<Map> maps = new ArrayList<>();
        positions.forEach(position -> {
            Map<String,Object> map = new HashMap<>();
            map.put("name",position.getPostName());
            map.put("id",position.getId());
            maps.add(map);
        });
        return new Vo(maps);
    }
}
